A flash memory has the property (retention property) that data stored in the flash memory gradually changes according to elapsed time since storage of the data; and also has the property (read disturb property) that as data is read more than once, the read data gradually changes. Therefore, the semiconductor storage apparatus equipped with a flash memory as storage media generally adds an ECC (Error Correcting Code), which has the ability to correct a plurality of bits, to data when writing the data, and stores it in the storage area of the flash memory. Consequently, failure bits which changed from original data can be corrected by using this ECC when reading data. As a result, the semiconductor storage apparatus can realize accurate data retention.
Under the above-described circumstance, if a data retaining period is long in the semiconductor storage apparatus, or if data in a specific area is read locally more than once, or if these conditions are combined, failure bits might occur beyond the ECC correction ability. In this case, the reliability of data stored by the semiconductor storage apparatus will degrade and not be maintained. Conventionally, in order to deal with this type of ECC correction disability failure and maintain a sufficiently low probability of occurrence of this ECC correction disability failure, there is a method of reading data, which is already stored in a flash memory, once before the number of failure bits which have changed from the original data exceeds the number of bits which can be corrected by the ECC, correcting the failure bits of the read data by the ECC, and then storing the corrected data to another storage area in the flash memory again. This operation of storing the already stored data again for the purpose of correcting the failure bits is called refresh.
It is necessary to execute refresh according to an increase of the number of failure bits in order to prevent the ECC correction disability failure appropriately. Specifically speaking, it is necessary to execute refresh before the number of failure bits increases and exceeds the number of bits which can be corrected by the ECC.
For example, since the number of failure bits caused by read disturb changes depending on the cumulative number of times data is read from a specific storage area, it is desirable that refresh should be executed in accordance with read frequency.
Therefore, Patent Literature 1 discloses the technology of counting the number of times of reading when reading data from a flash memory; reading stored data once and checking the number of failure bits if the number of times of reading reaches a certain value; and executing refresh if the number of failure bits is equal to or larger than a previously specified number.
Furthermore, since the number of failure bits caused by the retention property changes depending on the elapsed time since storage of data, it is desirable that refresh should be executed in accordance with the elapsed time since storage of data.
Therefore, Patent Literature 2 discloses the technology of storing data in a flash memory, then counting the elapsed time since storage of the data, and executing refresh if the elapsed time exceeds a previously specified period of time.
Furthermore, the number of failure bits also tends to change depending on the degree of deterioration of a storage area; for example, the number of failure bits tends to increase in a storage area whose degree of deterioration is high as compared to a storage area whose degree of deterioration is low even if the read frequency is low and the elapsed time since storage of the data is short.
Therefore, Patent Literature 3 discloses the technology of predicting the number of failure bits in the future by considering the degree of deterioration of a storage area in a flash memory; and if it is determined that it will be impossible to maintain the reliability in the future, that is, if it is determined that the number of failure bits will exceed the number of bits that can be corrected by the ECC, restoring a data retaining property by copying the stored data to another storage area and making the copy source storage area unavailable for a certain period of time.